package com.flyco.modules.stm.entity;

/**
 * 单据类型
 * @Author hui_li
 * @Date 2020/11/12 13:08
 * @Version 1.0
 */
public enum SourceType {
    RECEIPT_TYPE_PACKAGE("组装单"),
    RECEIPT_TYPE_SALE("销售订单"),
    RECEIPT_TYPE_CONVERT("转换单"),
    RECEIPT_TYPE_RETURN("退货单"),
    RECEIPT_TYPE_MOVE("移库单"),
    RECEIPT_TYPE_PURCHASE("采购单"),
    RECEIPT_TYPE_TRANSFER("调拨单"),
    RECEIPT_TYPE_CHECK("盘点单"),
    RECEIPT_TYPE_REPLENISHMENT("补货单"),
    RECEIPT_TYPE_RETREAT("退仓单")
    ;

    public static String getTitle(String name){
        try {
            SourceType sourceType = SourceType.valueOf(name.toUpperCase());
            return sourceType.title;
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
        }
        return null;
    }   
    public static SourceType getType(String name){
        try {
            SourceType sourceType = SourceType.valueOf(name.toUpperCase());
            return sourceType;
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
        }
        return null;
    }

    private String title;

    SourceType(String title) {
        this.title = title;
    }
}
